package com.liang.text5;

import java.util.ArrayList;

public class GongXian {
    public static void main(String[] args) {
        
        int[] arr = {1,1,1,1,4,2,4,6,9,7,8,10};
        int[] arr1 = {1, 2, 3, 4, 1, 2, 4, 6, 5, 6, 2, 10};



        //生成所有的x，y的数组
        for (int i = 0; i < arr.length; i++) {

            ArrayList<Xian> list = new ArrayList();
            for (int k = 0; k < arr1.length; k++) {
                int x = arr[i];
                int y = arr1[k];
                //int[] arr2 = {x, y};
                //System.out.println(arr2[0]);
                Xian xian = new Xian(x, y);

                list.add(xian);
            }
            //对数组进行遍历两个成一对计算出a，b
            for (int a = 0; a < list.size(); a++) {
                for (int b = a+1; b< list.size(); b++) {
                    System.out.println(list.get(a));
                    Xian l1 = list.get(a);
                    Xian l2 = list.get(b);

                    double k = (l2.y-l1.y)/(l2.x-l1.x);
                }


            }

        }



    }
}

class Xian{
    double x;
    double y;

    public Xian() {
    }

    public Xian(int x, int y) {
        this.x = x;
        this.y = y;
    }
}